﻿using System;
using SharpSqlAnalyzer.nodes;

namespace SharpSqlAnalyzer.stmt.redshift
{
	// Token: 0x0200010F RID: 271
	public class TRedshiftDeclare : TCustomSqlStatement
	{
		// Token: 0x060008E0 RID: 2272 RVA: 0x003029ED File Offset: 0x00300BED
		public TRedshiftDeclare(EDbVendor dbvendor) : base(dbvendor)
		{
			this.sqlstatementtype = ESqlStatementType.sstredshiftDeclare;
		}

		// Token: 0x17000190 RID: 400
		// (get) Token: 0x060008E1 RID: 2273 RVA: 0x00302A01 File Offset: 0x00300C01
		// (set) Token: 0x060008E2 RID: 2274 RVA: 0x00302A09 File Offset: 0x00300C09
		public virtual TObjectName CursorName
		{
			get
			{
				return this.cursorName;
			}
			set
			{
				this.cursorName = value;
			}
		}

		// Token: 0x17000191 RID: 401
		// (get) Token: 0x060008E3 RID: 2275 RVA: 0x00302A12 File Offset: 0x00300C12
		// (set) Token: 0x060008E4 RID: 2276 RVA: 0x00302A1A File Offset: 0x00300C1A
		public virtual TSelectSqlStatement Subquery
		{
			get
			{
				return this.subquery;
			}
			set
			{
				this.subquery = value;
			}
		}

		// Token: 0x060008E5 RID: 2277 RVA: 0x00302A24 File Offset: 0x00300C24
		public override int doParseStatement(TCustomSqlStatement psql)
		{
			if (this.rootNode == null)
			{
				return -1;
			}
			base.doParseStatement(psql);
			TDummy tdummy = (TDummy)this.rootNode;
			this.cursorName = (TObjectName)tdummy.node1;
			this.subquery = new TSelectSqlStatement(this.dbvendor);
			this.subquery.rootNode = tdummy.node2;
			this.subquery.doParseStatement(this);
			return 0;
		}

		// Token: 0x060008E6 RID: 2278 RVA: 0x00302A90 File Offset: 0x00300C90
		public override void accept(TParseTreeVisitor v)
		{
			v.preVisit(this);
			v.postVisit(this);
		}

		// Token: 0x060008E7 RID: 2279 RVA: 0x00302AA0 File Offset: 0x00300CA0
		public override void acceptChildren(TParseTreeVisitor v)
		{
			v.preVisit(this);
			this.subquery.accept(v);
			v.postVisit(this);
		}

		// Token: 0x04001230 RID: 4656
		private TObjectName cursorName;

		// Token: 0x04001231 RID: 4657
		private TSelectSqlStatement subquery;
	}
}
